From: Steven G. Johnson Date: Fri, 18 Jul 2014 15:47:24 +0000 (-0400) Subject: C++/MSVC compatibility, indenting, for #4 X-Git-Tag: archive/raspbian/2.11.3-2+rpi1^2~24^2^2~242 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=dd35a8530d4274ce7c4c0c080a66b283141b9454;p=utf8proc.git C++/MSVC compatibility, indenting, for #4 --- diff --git a/utf8proc.c b/utf8proc.c index ef2d433..e6c51f7 100644 --- a/utf8proc.c +++ b/utf8proc.c @@ -536,7 +536,7 @@ ssize_t utf8proc_map( *dstptr = NULL; result = utf8proc_decompose(str, strlen, NULL, 0, options); if (result < 0) return result; - buffer = malloc(result * sizeof(int32_t) + 1); + buffer = (int32_t *) malloc(result * sizeof(int32_t) + 1); if (!buffer) return UTF8PROC_ERROR_NOMEM; result = utf8proc_decompose(str, strlen, buffer, result, options); if (result < 0) { @@ -550,7 +550,7 @@ ssize_t utf8proc_map( } { int32_t *newptr; - newptr = realloc(buffer, (size_t)result+1); + newptr = (int32_t *) realloc(buffer, (size_t)result+1); if (newptr) buffer = newptr; } *dstptr = (uint8_t *)buffer; diff --git a/utf8proc.h b/utf8proc.h index 24a891b..3dac24d 100644 --- a/utf8proc.h +++ b/utf8proc.h @@ -60,16 +60,18 @@ typedef unsigned char uint8_t; typedef short int16_t; typedef unsigned short uint16_t; typedef int int32_t; -#ifdef _WIN64 -#define ssize_t __int64 -#else -#define ssize_t int -#endif +# ifdef _WIN64 +# define ssize_t __int64 +# else +# define ssize_t int +# endif +# ifndef __cplusplus typedef unsigned char bool; enum {false, true}; +# endif #else -#include -#include +# include +# include #endif #include